<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
    <link rel="stylesheet" href="./css/metro-all.css">
    <link rel="stylesheet" href="./css/metro-colors.css">
    <link rel="stylesheet" href="./css/metro-icons.css">


</head>
<body>
<div class="flex-content">
<h1>Login</h1>

            <br>
<hr>
<br>
            <div class="row">
                <div class="cell">
                    <div> </div>
                </div>
                <div class="colspan-6 line-height1.5">
<form action="userLogin" method="post">

<input type="text" name="userid">
<hr>

<input type="password" name="pwd">


<hr>

<select id="sr" name="roleid">

</select>

<hr>
<br>
<input class="button primary outline" type="submit" value="提交">
</form>
                </div>
                <div class="cell">
                    <div> </div>
                </div>

            </div>
            <br>





 
</div>




<script src="./js/jquery-3.3.1.js"></script>
<script src="./js/metro1.js"></script>
<script>

	$(document).ready(function() {

		$.get("getRole", {}, function(rs) {
			var r=$.parseJSON(rs);
			console.log(r.rs[1]);
			
			for(i=0;i<r.rs.length;i++){
				str="<option value='"+r.rs[i].roleid+"'>";
				str+=r.rs[i].rolename+"</option>";
				$("#sr").append(str);
			}
				//$("#sr").append("<option value=''>")
				//alert(r[i].rolename);
		});

	});
</script>
</body>
</html>